﻿using QingZhouLinYe.HttpApi.Models.Converters;
using SqlSugar;

namespace QingZhouLinYe.HttpApi.Models
{
        [SugarTable("FangHuoDanWei")]
    public class FangHuoDanWei
    {
            [SugarColumn(IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "主键Id")]
            public int Id { get; set; }

            [SugarColumn(ColumnDescription = "单位编码", IsTreeKey = true)]
            public string? Code { get; set; }

            [SugarColumn(ColumnDescription = "上级单位编码", IsTreeKey = true)]
            public string? UpCode { get; set; }

            [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "单位名称")]
            public string? MingCheng { get; set; }

            [SugarColumn(ColumnDescription = "中心位置", IsNullable = true, ColumnDataType = "geometry", SqlParameterDbType = typeof(PointConverter))]
            public Point? CenterShape { get; set; }

            [SugarColumn(ColumnDescription = "边界", IsNullable = true, ColumnDataType = "geometry", SqlParameterDbType = typeof(PolygonConverter))]
            public Polygon? BorderShape { get; set; }

            [SugarColumn(ColumnDescription ="缩放等级")]
            public int? MapLevel { get; set; }


            [SugarColumn(IsIgnore =true)]
            //[Navigate(NavigateType.OneToMany, nameof(UpCode))]  //导航一对多
            public List<FangHuoDanWei>? Child { get; set; }

    }
}
